package com.gxa.zhonglong.service;

import com.gxa.zhonglong.exception.BusinessException;
import com.gxa.zhonglong.pojo.Goods;
import com.gxa.zhonglong.pojo.GoodsMaterial;
import com.gxa.zhonglong.pojo.GoodsMaterialDetail;
import com.gxa.zhonglong.pojo.Where;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @author asus
 */
@Service
public interface GoodsMaterialService {

    /**
     * 添加商品拆料表
     * @param goodsMaterial
     */
    void insertGoodsMaterial(GoodsMaterial goodsMaterial);


    /**
     * 添加GoodsMaterialDetail表的数据
     * @param /Goods实体类
     */
    void insertGoodsMaterialD(Goods goods);


    /**
     * 根据单据编号查询GoodsMaterial表中的数据
     *
     * @param receiptNumber 单据编号
     * @return 返回list
     */
    List<Map<String, Object>> selectByReceiptNumberGoodsMaterial(String receiptNumber);


    /**
     * goodsMaterial表和Inventory表根据单据编号进行联合查询Goods表的信息
     * @param receiptNumber
     * @return
     */
    List<Map<String,Object>> selectByReceiptNumberGoods(String receiptNumber);

    /**
     * 根据单据条件进行联合查询
     * @param  /receiptNumber
     * @return 返回集合
     */
    List<Map<String, Object>> selectByWhere(Where where);


    /**
     * 根据条件进行联合查询
     * @param  /receiptNumber
     * @return
     */
    List<Map<String,Object>> selectByWhereNoPage(Where where);

    /**
     * 更新商品拆料表
     * @param /Inventory 更新的参数作为对象
     */
    void updateByReceiptNumber(GoodsMaterial goodsMaterial);

    /**
     * 根据单据编号删除商品拆料表的记录
     * @param receiptNumber 商品编号
     */
    void deleteByReceiptNumberGoodsMaterial(String receiptNumber);


    /**
     * 根据商品编号删除商品记录
     * @param number 商品编号
     */
    void deleteByNumber(String number) throws BusinessException;



}
